package day26;

/**
 * 题目：跳台阶扩展问题
 * 题目链接：https://www.nowcoder.com/questionTerminal/22243d016f6b47f2a6928b4313c85387?
 * 青蛙变态跳台阶
 * f[n] = f[n-1] + f[n-2] + f[n-3] + .....+f[1]
 * 所以  f[n-1] = f[n-2] + f[n-3] + ......+f[1]
 * 所以  f[n] = 2*f[n-1]
 */
public class Main {
    public int jumpFloorII(int target) {
        if(target == 1) return 1;   //递归结束条件
        return 2*jumpFloorII(target-1);
    }
}
